<template>
    <div class="mainContainer">
        <div class="imgBar">
            <div class="imgList" v-for="item in myImgList" :key="item.index">
                <img v-lazy="item.src" />
            </div>
        </div>
        <div class="content"></div>
    </div>
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue'
import img1 from '@/assets/myImg/1.png'
const img = ref()
//图片列表
const myImgList = ref([
    {
        src: img1,
        alt: '1',
        index: 1
    },
    {
        src: 'src/assets/myImg/2.png',
        alt: '2',
        index: 2
    },
    {
        src: 'src/assets/myImg/3.png',
        alt: '3',
        index: 3
    },
    {
        src: 'src/assets/myImg/4.png',
        alt: '4',
        index: 4
    },
])
</script>
<style scoped>
.mainContainer {
    position: fixed;
    left: 60%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    /* 保持原有宽度 */
    height: 80%;
    /* 保持原有高度 */
    background: linear-gradient(145deg, rgba(59, 59, 61, 0.8), rgba(45, 45, 47, 0.9));
    backdrop-filter: blur(12px);
    border: 1px solid rgba(190, 198, 199, 0.8);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    background-color: rgba(59, 59, 61, 0.8);
    border-radius: 24px;
    margin: 0 auto;
    border: 1px solid rgb(190, 198, 199);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 100;

    &::before {
        content: '';
        position: absolute;
        width: 150%;
        height: 150%;
        background: linear-gradient(45deg,
                rgba(255, 255, 255, 0.1) 0%,
                rgba(255, 255, 255, 0.05) 50%,
                rgba(255, 255, 255, 0.1) 100%);
        transform: rotate(30deg) translate(-20%, -50%);
        animation: lightFlow 6s infinite linear;
        opacity: 0.8;
    }

    &:hover {
        transform: translate(-50%, calc(-50% - 8px));
        box-shadow: 0 20px 56px rgba(0, 0, 0, 0.4);
    }
}

@keyframes lightFlow {
    0% {
        transform: rotate(30deg) translate(-25%, -40%);
    }

    100% {
        transform: rotate(30deg) translate(125%, 60%);
    }
}

.content {
    height: auto;
    width: 100%;
    flex-direction: row-reverse;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 20px;
    margin: 10px solid #c5c5c5;
}

.imgBar {
    height: 95vh;
    width: 100%;
    top: 30%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    background-color: transparent;
    overflow: auto;
    padding: 30px;
    box-sizing: border-box;

    img {
        width: 45%;
        height: auto;
        margin: 20px;
        transition: all 0.3s ease-in-out;
        border-radius: 12px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    }

    .imgList {
        position: relative;
        display: flex;
        height: auto;
        justify-content: center;
        align-items: center;
    }
}

.imgBar img:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}
</style>